#include "tree.h"

#ifndef BINARYHEAP_H
#define BINARYHEAP_H

typedef struct ItemBH {
    int freq;
    Node* data;
} ItemBH;

/*
    Fila de prioridade de menor valor.
*/
class BinaryHeap
{
    public:
        static const int MAX_SIZE = 256;
        BinaryHeap();
        BinaryHeap(int size);
        virtual ~BinaryHeap();
        int size();
        void insert(ItemBH item);
        void insert(int freq, Node* data);
        ItemBH remove();
    private:
        int capacity;
        int actual_size;
        ItemBH *t;
        bool orderItsOk;
        void up(int freq);
        void down(int freq);
};

#endif // BINARYHEAP_H
